<%@page import="com.hnas.sys.service.system.dto.DTOUser"%>
<%@page import="com.hnas.sys.core.util.UserUtils"%>
<%@page import="java.util.Calendar"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib prefix="decorator" uri="http://www.opensymphony.com/sitemesh/decorator"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta name="keywords" content="" />
		<meta name="description" content="" />
		<title>特约商家管理系统</title>
		<link href="${pageContext.request.contextPath }/static/common/style/basic.css" rel="stylesheet" type="text/css" />
		<link href="${pageContext.request.contextPath }/static/common/style/index.css" rel="stylesheet" type="text/css" />
		<link  href="${pageContext.request.contextPath  }/static/common/style/dialog.css"  rel="stylesheet" type="text/css"/>
		<script type="text/javascript" src="${pageContext.request.contextPath }/static/js/jquery-1.10.2.min.js"></script>
		<script type="text/javascript" src="${pageContext.request.contextPath }/static/js/bootstrap-datepicker.js"></script>
		<script type="text/javascript" src="${pageContext.request.contextPath }/static/js/jquery.timepicker.js"></script>
		<script type="text/javascript" src="${pageContext.request.contextPath }/static/js/jquery.datepair.js"></script>
		<script type="text/javascript" src="${pageContext.request.contextPath }/static/js/util.js"></script>
		    <script type="text/javascript" src="${pageContext.request.contextPath }/static/common/script/jquery.dialog.js"></script>
		<script type="text/javascript">
			function changeImage() {
		    	$('#validateCodeImg').hide().attr('src', '${pageContext.request.contextPath }/codeImage?' + Math.floor(Math.random()*100) ).fadeIn();  
		    	event.cancelBubble=true;  
			} 
			function checkEmpty(f){
				if (f.j_username.value=='')
				{
					//alert('请输入用户名！');
					$.dialog.alert({title:"登陆",content:"请输入账号！",objCtrl:"#j_username"});
					f.j_username.focus();
					return false;
				}
				if (f.j_password.value=='')
				{
					//alert('请输入密码！');
					$.dialog.alert({title:"登陆",content:"请输入密码！",objCtrl:"#j_password"});
					f.j_password.focus();
					return false;
				}
				if (f.sms_img_code.value=='')
				{
					//alert('请输入图片验证码！');
					$.dialog.alert({title:"登陆",content:"请输入图片验证码！",objCtrl:"#sms_img_code"});
					f.sms_img_code.focus();
					return false;
				}
				sessionStorage.openRow = 0;
				return true;

			}
		</script>
	</head>
	<body>
		<%
			DTOUser user = null;
			String name = "";
			try{
			 	user = UserUtils.getCurrentUser();
			 	if(user!=null) {
			 		name = user.getName();
			 	}
			}catch(Exception ex){
				
			}
		%>
		<%@ include file="inc_head.jsp" %>
		<div class="containerIndex">
			<!-- 主要内容 -->
			<div class="content1">

				<div class="bannerBar1 m_b_36">
					<div class="pics">
					<img src="${pageContext.request.contextPath }/static/common/images/banner_01.jpg" />
					</div>
					<div class="sysNameBar">
					海&nbsp;南&nbsp;一&nbsp;卡&nbsp;通<br/><br/>特&nbsp;约&nbsp;商&nbsp;家&nbsp;管&nbsp;理&nbsp;系&nbsp;统
					</div>
					<% if(user==null) { %>
					<div class="loginBar">
						<form method="post" action="${pageContext.request.contextPath }/j_spring_security_check" name="loginForm" id="logingForm" onsubmit='return checkEmpty(this);' >
						<div class="p_20">
							<h3 class="tit">欢迎登录 <em class="f_18 c_ea2c2c">${sessionScope.loginfail}</em></h3>
							<p class="item"><input style="width:63%;" class="input_style1" type="text" name="j_username" id="j_username" placeholder="请输入您的账号"></p>
							<p class="item"><input style="width:63%;" class="input_style1" type="password" name="j_password" id="j_password" placeholder="请输入密码">
							<p class="item"><input style="width:30%;" class="input_style1" type="text" name="validateCode" id="sms_img_code" placeholder="请输入验证码">
							<a href="javascript:void(0);" style="text-align:justify;"><img style="vertical-align:middle;" src="${pageContext.request.contextPath }/codeImage" alt="点击更换图片" onclick="changeImage();" id="validateCodeImg" width="90" /></a>
							</p>
							<p class="item"><input style="width:98%;" class="btn_red01" type="submit" value="立即登录"></p>
						</div>
						</form>
					</div>
					<%} %>
				</div>
				<div class="sysTitleBar">
					推荐使用浏览器:&nbsp;IE9以上,谷歌,火狐。
					</div>
			</div>
			<!-- end 主要内容 -->
		</div>
		<!-- 站点信息 -->
	<div class="footBar">
		<div class="w_1200a cf">
			
			<div class="copy">琼ICP备21321321号 Copy<em>&copy;</em>2015  www.yktg.com All Right Reserved</div>
		</div>
	</div>
		<!-- end 站点信息 -->
</body>
</html>